//
//  SEInquiryHeaderView.swift
//  SmartEyeForDoctor
//
//  Created by QDSG on 2021/4/20.
//

import UIKit

class SEInquiryHeaderView: UIView {

    @IBOutlet private weak var avatarImageView: UIImageView! {
        didSet {
            avatarImageView.layer.cornerRadius = avatarImageView.height / 2
        }
    }
    @IBOutlet private weak var nameLabel: UILabel!
    @IBOutlet private weak var hospitalLabel: UILabel!
    
    @IBOutlet private weak var containerView: UIView! {
        didSet {
            containerView.setLayerCorners(rect: containerView.bounds, radius: 14)
            containerView.setShadow()
        }
    }
    @IBOutlet private weak var patientNumLabel: UILabel!
    @IBOutlet private weak var commentNumLabel: UILabel!
    @IBOutlet private weak var followerNumLabel: UILabel!

    func updateData(_ viewModel: SEInquiryViewModel) {
        avatarImageView.kf.setImage(urlString: viewModel.userInfoViewModel.model.imgPath,
                                    placeholder: viewModel.userInfoViewModel.avatarPlaceholder)
        nameLabel.text = viewModel.userInfoViewModel.model.name
        hospitalLabel.text = viewModel.userInfoViewModel.model.hospitalName
        patientNumLabel.text = viewModel.doctorCountModel.patientCount
        commentNumLabel.text = viewModel.doctorCountModel.commentCount
        followerNumLabel.text = viewModel.doctorCountModel.followCount
    }

}
